home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_10
/
1010106a
< prev
next >
Wrap
Text File
|
1992-08-09
|
545b
|
38 lines
#define GAME_C
#include <stdio.h>
#include <stdlib.h>
#include "game.h"
void piece_move(PIECE piece)
{
switch (piece->piece_type){
case PAWN:
pawn_move(piece->moves->PawnM);
break;
case BISHOP:
bishop_move(piece->moves->BishopM);
break;
case ROOK:
rook_move(piece->moves->RookM);
break;
case KING:
king_move(piece->moves->KingM);
break;
default:
fprintf(stderr, "Unknown Playing piece.\n");
exit (1);
}
}
void calling_func()
{
PIECE tmp;
/* set tmp equal to one of game pieces */
/*...*/
move_piece (tmp);
}